package com.aaa.service.back.Impl;

import com.aaa.entity.*;
import com.aaa.mapper.back.AllotMapper;
import com.aaa.service.back.AllotService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class AllotServiceImpl implements AllotService {

    @Resource
    private AllotMapper allotMapper;

    @Override
    public List<Map<String, Object>> findAllotState() {
        return allotMapper.findAllotState();
    }

    @Override
    public List<Map<String, Object>> findAllotState0() {
        return allotMapper.findAllotState0();
    }

    @Override
    public List<Map<String, Object>> findAllotByAllotState1() {
        return allotMapper.findAllotByAllotState1();
    }

    @Override
    public List<Map<String, Object>> findAllotByAllotState0() {
        return allotMapper.findAllotByAllotState0();
    }

    @Override
    public List<Map<String, Object>> findAllotDetails(String allotId) {
        return allotMapper.findAllotDetails(allotId);
    }

    @Override
    public List<Map<String, Object>> findAllotOut1() {
        return allotMapper.findAllotOut1();
    }

    @Override
    public List<Map<String, Object>> findAllotOut0() {
        return allotMapper.findAllotOut0();
    }

    @Override
    public List<Map<String, Object>> findAllotEntry1() {
        return allotMapper.findAllotEntry1();
    }

    @Override
    public List<Map<String, Object>> findAllotEntry0() {
        return allotMapper.findAllotEntry0();
    }

    @Override
    public AllotOut findByAllotOutId(String allotOutId) {
        return allotMapper.findByAllotOutId(allotOutId);
    }

    @Override
    public AllotEntry findByAllotEntryId(String allotEntryId) {
        return allotMapper.findByAllotEntryId(allotEntryId);
    }

    @Override
    public List<Map<String, Object>> findAllotOutDetails(String allotOutId) {
        return allotMapper.findAllotOutDetails(allotOutId);
    }

    @Override
    public List<Map<String, Object>> findAllotEntryDetails(String allotEntryId) {
        return allotMapper.findAllotEntryDetails(allotEntryId);
    }

    @Override
    public List<AllotOutDetails> findByAllotOutDetails(String allotOutId) {
        return allotMapper.findByAllotOutDetails(allotOutId);
    }

    @Override
    public List<AllotEntryDetails> findByAllotEntryDetails(String allotEntryId) {
        return allotMapper.findByAllotEntryDetails(allotEntryId);
    }

    @Override
    public int editAllot1(String allotId) {
        return allotMapper.editAllot1(allotId);
    }

    @Override
    public int addAllot(Allot allot) {
        return allotMapper.addAllot(allot);
    }

    @Override
    public int addAllotOut(AllotOut allotOut) {
        return allotMapper.addAllotOut(allotOut);
    }

    @Override
    public int addAllotOutDetails(AllotOutDetails allotOutDetails) {
        return allotMapper.addAllotOutDetails(allotOutDetails);
    }

    @Override
    public int addAllotEntry(AllotEntry allotEntry) {
        return allotMapper.addAllotEntry(allotEntry);
    }

    @Override
    public int addAllotEntryDetails(AllotEntryDetails allotEntryDetails) {
        return allotMapper.addAllotEntryDetails(allotEntryDetails);
    }

    @Override
    public int addAllotDetails(AllotDetails allotDetails) {
        return allotMapper.addAllotDetails(allotDetails);
    }

    @Override
    public int editAllotOut(AllotOut allotOut) {
        return allotMapper.editAllotOut(allotOut);
    }

    @Override
    public int editAllotEntry(AllotEntry allotEntry) {
        return allotMapper.editAllotEntry(allotEntry);
    }

    @Override
    public int editWarehouseDetailsReduce(Integer goodsCount, String goodsId, Integer warehouseId) {
        Map map = new HashMap<String,Object>();
        map.put("goodsCount",goodsCount);
        map.put("goodsId",goodsId);
        map.put("warehouseId",warehouseId);
        return allotMapper.editWarehouseDetailsReduce(map);
    }

    @Override
    public int editWarehouseDetailsIncrease(Integer goodsCount,String goodsId,Integer warehouseId) {
        Map map = new HashMap<String,Object>();
        map.put("goodsCount",goodsCount);
        map.put("goodsId",goodsId);
        map.put("warehouseId",warehouseId);
        return allotMapper.editWarehouseDetailsIncrease(map);
    }

    @Override
    public String findAllotByMAX() {
        return allotMapper.findAllotByMAX();
    }
}
